import React, { Component } from "react";
import { HashRouter, Route, Redirect, Switch} from "react-router-dom";
import Appa from "./view/Appa";
import Appb from "./view/Appb";
import Appc from "./view/Appc";
import Notfound from "./view/Notfound";
class IndexRoute extends Component {
  render() {
    return (
        <HashRouter>
            {/* switch 匹配到之后立即执行 */}
          <Switch>  
            <Route path="/a" component={Appa}></Route>
            <Route path="/b" component={Appb}></Route>
            <Route path="/c" component={Appc}></Route>
            {/* exact 表示的是精准匹配 */}
            <Redirect form='/' to='/a' />
            <Route component={Notfound}/>
          </Switch>
        </HashRouter>
    );
  }
}

export default IndexRoute;
